import { defineStore } from 'pinia'
/**
 * app全局配置
 */
import { useWindowSize } from '@vueuse/core'

export const useAppStore = defineStore({
  id: 'app',
  state: () => ({
    scale: 1
  }),

  getters: {
    // 客户端窗口尺寸宽高（resize动态赋值）
    windowRect: () => ({
      clientWidth: useWindowSize().width.value,
      clientHeight: useWindowSize().height.value
    }),
    getScale: state => {
      return state.scale
    }
  },

  actions: {},

  // 持久化数据
  persist: {
    enabled: true
  }
})
